import {option} from "@/api/http.js"


export function createBack(form){
  return option({
    url:'back/backMoney',
    method:'post',
    data:form,
    headers:{
      'Content-Type': 'multipart/form-data'
    }
  })
}


export function doBackCheck(form){
  return option({
    url:'back/doBackCheck',
    method:'post',
    data:form,
    headers:{
      'Content-Type': 'multipart/form-data'
    }
  })
}


export function resubmitBack(form){
  return option({
    url:'back/resubmitBack',
    method:'post',
    data:form,
    headers:{
      'Content-Type': 'multipart/form-data'
    }
  })
}


export function getUnreadBack(userId){
  return option({
    url:'back/getUnreadBack',
    method:'post',
    data:{
      userId
    },
  })
}


export function getTotalBackCount(userId){
  return option({
    url:'back/getTotalBackCount',
    method:'post',
    data:{
      userId
    },
  })
}


export function getMyBackCopy(userId){
  return option({
    url:'back/getMyBackCopy',
    method:'post',
    data:{
      userId
    },
  })
}


export function searchBackByWord(userId,keyword){
  return option({
    url:'back/searchBackByWord',
    method:'post',
    data:{
      userId,
      keyword
    },
  })
}


export function searchBackWorkByWord(userId,keyword){
  return option({
    url:'back/searchBackWorkByWord',
    method:'post',
    data:{
      userId,
      keyword
    },
  })
}

export function previewBack(backId){
  return option({
    url:'back/previewBack',
    method:'post',
    data:{
      backId
    },
    responseType:'blob'
  })
}


export function downloadBack(backId){
  return option({
    url:'back/downloadBack',
    method:'post',
    data:{
      backId
    },
    responseType:'blob'
  })
}


export function previewBackHistory(backHistoryId){
  return option({
    url:'back/previewBackHistory',
    method:'post',
    data:{
      backHistoryId
    },
    responseType:'blob'
  })
}


export function downloadBackHistory(backHistoryId){
  return option({
    url:'back/downloadBackHistory',
    method:'post',
    data:{
      backHistoryId
    },
    responseType:'blob'
  })
}


